package com.sunky.db.model;

import com.sunky.db.greendao.ClassTypeBeanDao;
import com.sunky.db.greendao.DaoSession;
import com.sunky.db.greendao.EquipInfoDao;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.ToOne;

@Entity
public class ClassTypeBean {
    /**
     * serviceName :
     * serviceCount :
     */
    @Id
    private long id;
    private String serviceName;
    private String serviceCount;
    private int order;
    @ToOne(joinProperty = "id")
    private EquipInfo equipInfo;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 1108715672)
    private transient ClassTypeBeanDao myDao;
    @Generated(hash = 35626581)
    public ClassTypeBean(long id, String serviceName, String serviceCount, int order) {
        this.id = id;
        this.serviceName = serviceName;
        this.serviceCount = serviceCount;
        this.order = order;
    }
    @Generated(hash = 2084291765)
    public ClassTypeBean() {
    }
    public long getId() {
        return this.id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public String getServiceName() {
        return this.serviceName;
    }
    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }
    public String getServiceCount() {
        return this.serviceCount;
    }
    public void setServiceCount(String serviceCount) {
        this.serviceCount = serviceCount;
    }
    @Generated(hash = 1960740041)
    private transient Long equipInfo__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 29223382)
    public EquipInfo getEquipInfo() {
        long __key = this.id;
        if (equipInfo__resolvedKey == null
                || !equipInfo__resolvedKey.equals(__key)) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            EquipInfoDao targetDao = daoSession.getEquipInfoDao();
            EquipInfo equipInfoNew = targetDao.load(__key);
            synchronized (this) {
                equipInfo = equipInfoNew;
                equipInfo__resolvedKey = __key;
            }
        }
        return equipInfo;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 2033063413)
    public void setEquipInfo(@NotNull EquipInfo equipInfo) {
        if (equipInfo == null) {
            throw new DaoException(
                    "To-one property 'id' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.equipInfo = equipInfo;
            id = equipInfo.getId();
            equipInfo__resolvedKey = id;
        }
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 538098875)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getClassTypeBeanDao() : null;
    }
    public int getOrder() {
        return this.order;
    }
    public void setOrder(int order) {
        this.order = order;
    }

}
